@extends('home.pc.public.public')

@section('main')
    <div class="miya_message">
        <div class="miya_message_left">
            <div class="miya_template_left_box">
                <h3 class="miya_template_left_box_title">{{ $pageLabels['about'] }}</h3>
                <ul class="miya_template_left_box_ul">
                    @foreach($pages['about'] as $value)
                        <li><a href="{{ route('page',['about',$value['id']]) }}">{{ $value['name'] }}</a></li>
                    @endforeach
                </ul>
            </div>
            <div class="miya_template_left_box">
                <h3 class="miya_template_left_box_title">产品中心</h3>
                <ul class="miya_template_left_box_ul">
                    @foreach($sorts['product'] as $value)
                        <li><a href="{{ route('sort',['product',$value['id']]) }}">{{ $value['name'] }}</a></li>
                    @endforeach
                </ul>
            </div>
            <div class="miya_template_left_box">
                <h3 class="miya_template_left_box_title">新闻中心</h3>
                <ul class="miya_template_left_box_ul">
                    @foreach($sorts['new'] as $value)
                        <li><a href="{{ route('sort',['new',$value['id']]) }}">{{ $value['name'] }}</a></li>
                    @endforeach
                </ul>
            </div>
            <div class="miya_template_left_box">
                <h3 class="miya_template_left_box_title">案例中心</h3>
                <ul class="miya_template_left_box_ul">
                    @foreach($sorts['case'] as $value)
                        <li><a href="{{ route('sort',['case',$value['id']]) }}">{{ $value['name'] }}</a></li>
                    @endforeach
                </ul>
            </div>
            @include('home.pc.public.left')
        </div>
        <div class="miya_message_right frame_box">
            <h3 class="miya_message_right_title">在线留言</h3>
            @include('home.pc.public.frame')
            <form action="{{ route('message_do') }}" method="post">
                {!! csrf_field() !!}
                @if(!empty($info))
                    <input type="hidden" name="info" value="{{ $info['id'] }}">
                    <div class="miya_message_link_info">
                        <div class="miya_message_link_info_title">留言商品: <span>{{ $info['name'] }}</span></div>
                        <div class="miya_message_link_info_describe">{{ $info['simpledescribe'] }}</div>
                    </div>
                @endif
                <select name="type" id="">
                    @if(!empty($messageFields['type']))
                        @foreach($messageFields['type'] as $value)
                            <option value="{{ $value }}">{{ $value }}</option>
                        @endforeach
                    @endif
                </select>
                <input type="text" name="msg_name" placeholder="请输入您的姓名">
                <input type="text" name="phone" placeholder="请输入您的手机号码">
                <input type="text" name="email" placeholder="请输入您的邮箱">
                <textarea name="message" placeholder="请输入留言内容"></textarea>
                <button>提交留言</button>
            </form>

            <ul class="miya_message_right_list">
                @foreach($message as $value)
                    <li class="miya_message_right_list_li">
                        <div class="miya_message_right_list_li_date">{{ $value['created_at'] }}</div>
                        @foreach($value['data'] as $v)
                            <p>{{ $v }}</p>
                        @endforeach
                    </li>
                @endforeach
                <div class="clearfix"></div>
            </ul>
        </div>
        <div class="clearfix"></div>
    </div>
@endsection